Delete User
Get User Example
For deleting a specific user you need to use deleteUser and provide the user_id
Check the example:
import com.altibbi.telehealth.ApiService
import com.altibbi.telehealth.ApiCallback
ApiService.deleteUser(userId = id, callback = object : ApiCallback<Boolean> {
override fun onSuccess(response: Boolean) {
if (response) {
// User deleted successfully
}
}
override fun onFailure(error: String?) {
// Handle failure
}
override fun onRequestError(error: String?) {
// Handle request error
}
})
Responses
The
deleteUserwill return true if the user is deleted.
Status 401
UnauthorizedHttpException represents an Unauthorized HTTP exception with status code 401
{
"name": "Unauthorized",
"message": "Your request was made with invalid credentials",
"code": "0",
"status": "401",
"type": "yii\\\\web\\\\UnauthorizedHttpException"
}
Status 403
Current user cant access this page
{
"name": "Forbidden",
"message": "duplicate request OR Current user cant access this page",
"code": "0",
"status": "403",
"type": "yii\\\\web\\\\ForbiddenHttpException"
}
Status 404
User id invalid or deleted
{
"name": "Not Found",
"message": "Object not found: {id}",
"code": "0",
"status": "404",
"type": "yii\\\\web\\\\NotFoundHttpException"
}